﻿using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Globalization;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
using TimeSpan = System.TimeSpan;

namespace FuckJob.Winform
{
    public partial class SettingForm : Form
    {
        private Form1 parentForm;

        public SettingForm(Form1 parent)
        {
            InitializeComponent();

            parentForm = parent;

            startTb.Text = parentForm.startTime.ToString("hh\\:mm\\:ss");
            finishTb.Text = parentForm.endTime.ToString("hh\\:mm\\:ss");
            lunchTb.Text = parentForm.lunchStartTime.ToString("hh\\:mm\\:ss");
        }

        private void saveBtn_Click(object sender, EventArgs e)
        {
            parentForm.startTime = TimeSpan.Parse(startTb.Text);
            parentForm.endTime = TimeSpan.Parse(finishTb.Text);
            parentForm.lunchStartTime = TimeSpan.Parse(lunchTb.Text);

            this.Close();
        }

    }
}
